const { UnLoginModule } = require('../classes/result')

module.exports = async (ctx, next) => {
  ctx.session.user && ctx.session.user.id
    ? await next()
    : ctx.body = new UnLoginModule('unlogin')
}